package com.mall.cart.remote.factory;

import com.mall.cart.common.domain.Cart;
import com.mall.cart.remote.CartRemoteServer;
import com.mall.common.core.domain.Result;
import org.springframework.cloud.openfeign.FallbackFactory;

import java.util.List;

public class CartRemoteServerFactory implements FallbackFactory<CartRemoteServer>{
    @Override
    public CartRemoteServer create(Throwable cause) {
        return new CartRemoteServer() {
            @Override
            public Result<List<Cart>> findCartList() {
                return Result.error("已熔断");
            }
        };
    }
}
